package com.zyiot.Dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBOpenHelper extends SQLiteOpenHelper {
	private static final int VERSION = 1;
	private static final String DBNAME = "data.db";

	public DBOpenHelper(Context context) {
		super(context, DBNAME, null, VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("create table e_Message (msg_id integer primary key,msg_title varchar(20),msg_content varchar(255),msg_url varchar(255),msg_date varchar(20),msg_flag varchar(10) DEFAULT 'false')");
		db.execSQL("create table e_Reply (rep_id integer primary key,rep_state varchar(1))");
		db.execSQL("insert into e_Reply (rep_id,rep_state) values (1,0)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

	}

}
